<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>归档</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
</head>

<body class="bg3">
<!--导航-->
<div id="pjax-container">
    <nav th:replace="_fragments :: menu(4)" class="ui inverted attached segment m-shadow-small"></nav>
    <!--中间-->
    <div class="m-container m-padded-tb-big">
        <div class="ui container">
            <!--        header-->
            <div class="ui top only-transform attached segment" style="border: 0">
                <div class="ui middle aligned column grid">
                    <div class="column center aligned">
                        <h2 class="ui black header">归档</h2>
                    </div>
                </div>
            </div>
            <!--归档列表-->
            <th:block th:each="item : ${archiveMap}">
                <h2 class="ui center aligned header" style="color:#ffecf7;" th:text="${item.key}">2021</h2>
                <div class="ui white-transform fluid vertical menu">
                    <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="item m-padded-tb-small"
                       th:each="blog : ${item.value}">
            <span>
            <i class="mini blue book icon m-padded-lr-big"></i><span th:text="${blog.title}">
            </span>
                <div class="mini ui grey basic left pointing label" th:text="${#dates.format(blog.updateTime,'MM-dd')}"></div>
            </span>
                        <div class="mini basic ui red basic label m-padded-tb-littlesmall" th:text="${blog.flag}"></div>
                    </a>
                </div>
            </th:block>
        </div>
    </div>
</div>
<!--底部-->
<footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive"></footer>
<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<!--/*/</th:block>/*/-->
<!--利用jQuery获取到菜单-->
<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });
</script>
<script>
    $(function () {
        $(document).pjax('a[target!="_blank"]', '#pjax-container', {
            fragment: '#pjax-container',
            timeout: 8000,
            type: 'GET'
        });

        $(document).on('submit', 'form', function (event) {
            //var container = $(this).closest('[pjax-container]');
            $.pjax.submit(event, '#pjax-container', {
                fragment: '#pjax-container', timeout: 8000
            });
        });

    })
</script>
</body>
</html>